package com.glory.dgcpcpda.activity.mfg;

import android.view.View;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView;

import com.glory.dgcpcpda.R;
import com.glory.dgcpcpda.base.BaseActivity;
import com.pda.platform.ui.ui_pdaplatform.view.FreeUI_ClearEditText;

import butterknife.BindView;
import butterknife.OnClick;

public class ShelvesHandlerActivity extends BaseActivity {

    @BindView(R.id.tvTitle)
    TextView tvTitle;
    @BindView(R.id.tvBaseSubmit)
    TextView tvBaseSubmit;
    @BindView(R.id.etShelves)
    FreeUI_ClearEditText etShelves;
    @BindView(R.id.rbUp)
    RadioButton rbUp;
    @BindView(R.id.rbDown)
    RadioButton rbDown;
    @BindView(R.id.etLot)
    FreeUI_ClearEditText etLot;
    @BindView(R.id.rvResultMessageList)
    RecyclerView rvResultMessageList;
    @BindView(R.id.llMain)
    LinearLayout llMain;
    private String mShelvesType = "UP";

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_shelves_handler;
    }

    @Override
    protected void initView() {
        tvBaseSubmit.setVisibility(View.GONE);
        setMainLayout(llMain);
        tvTitle.setText("货架操作");
        initRecyclerView(rvResultMessageList,this);

        initEdit(etLot, s -> {
            if (getText(etShelves).equals("")){
                showToast("请先扫描货架号",false);
                etLot.setText("");
                return;
            }

            //todo: 货架上下架操作

        });
    }

    @Override
    protected void initData() {

    }

    @OnClick({R.id.rbUp, R.id.rbDown})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.rbUp:
                mShelvesType = "UP";
                break;
            case R.id.rbDown:
                mShelvesType = "DOWN";
                break;
        }
    }
}
